package cn.initcap.designpattern.pattern.behavioral.state;

/**
 * @author initcap
 * @date Created in 2018/11/1 PM11:28.
 */
public class CourseVideoContext {

    public static final PlayStateBase PLAY_STATE = new PlayStateBase();
    public static final StopStateBase STOP_STATE = new StopStateBase();
    public static final PauseStateBase PAUSE_STATE = new PauseStateBase();
    public static final SpeedStateBase SPEED_STATE = new SpeedStateBase();
    private BaseCourseVideoState baseCourseVideoState;

    public BaseCourseVideoState getBaseCourseVideoState() {
        return baseCourseVideoState;
    }

    public void setBaseCourseVideoState(BaseCourseVideoState baseCourseVideoState) {
        this.baseCourseVideoState = baseCourseVideoState;
        this.baseCourseVideoState.setCourseVideoContext(this);
    }

    public void play() {
        this.baseCourseVideoState.play();
    }

    public void speed() {
        this.baseCourseVideoState.speed();
    }

    public void stop() {
        this.baseCourseVideoState.stop();
    }

    public void pause() {
        this.baseCourseVideoState.pause();
    }

}
